
//获取params参数

import {useParams,useNavigate} from "react-router-dom"

//使用js 跳转地址


function Page1Son2(){
    let params = useParams()
    let navigate = useNavigate()
    return <>
        <div>Page1----son2 ---- 获取params参数 ：{JSON.stringify(params)}</div>
        <button onClick={()=>{navigate("/page1",{state:{msg:"不显示在路径的参数"}})}}>js跳转到Page1</button>
    </>
}

export default Page1Son2